let  data = {
    name: "vue",
    address: "中国"
}

let observer = new Observer(data);

function Observer(obj) {
    let keys = Object.keys(obj);
    keys.forEach((k) => {
        Object.defineProperty(this, k, {
            get() {
                return obj[k];
            },
            set(val) {
                obj[k] = val
            }
        })
    })
}

let vm = {}
vm.$data = data=observer


console.log()
